﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

/* Authors: Mike Poddo, Matt Gillette
 * Missile Command
 */

namespace MissileCommand
{
    public partial class EnterInformation : Form
    {
        private int PlayerScore;
        private String userName = "";

        public EnterInformation()
        {
            InitializeComponent();
            txtUserName.Focus();
        }

        /*
        public EnterInformation(String message, int PlayerScore)
        {
            this.PlayerScore = PlayerScore;
            txtMessage.Text = message;
        }
        */

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            userName = txtUserName.Text;
            if (userName == "" || userName == null)
            {
                MessageBox.Show("Enter your name!");
                userName = txtUserName.Text;
            }
            else
            {
                Properties.Settings.Default.userName = txtUserName.Text;
                Close();
            }
                /*
            HighScore hs = new HighScore(userName, PlayerScore);
            Properties.Settings.Default.HighScores.Add(hs);
            Properties.Settings.Default.HighScores.Sort();

            String ScoreList = "   Name   |   Score   \n";
            for (int x = 0; x < Properties.Settings.Default.HighScores.Count; x++)
            {
                ScoreList += Properties.Settings.Default.HighScores[x].ToString() + "\n";
            }
            if(MessageBox.Show(ScoreList, "High Scores", MessageBoxButtons.OK) == DialogResult.OK)
                this.Close();
            */
            

        }
    }
}
